<template>
  <div>App父级组件</div>
  <button @click="isShow=!isShow">切换显示</button>
  <MyChild v-if="isShow"/>
</template>
<script lang='ts'>
import { defineComponent,ref } from 'vue'
// 引入子级组件
import MyChild from './components/MyChild.vue'
export default defineComponent({
  name: 'App',
  // 注册组件
  components:{
    MyChild
  },
  setup(){
    const isShow = ref(true)
    return{
      isShow
    }
  }
})
</script>